import request from '@/utils/request'
/*
  params 会自动进行url拼接，其它类似name、search这些则不会自动拼接
*/

export function listWechatId(params) {
  return request({
    url: '/wechatid/',
    method: 'get',
    params
  })
}

export function TreeMobile() {
  return request({
    url: '/mobile_tree/',
    method: 'get'
  })
}

export function checkWechatIdName(params) {
  return request({
    url: '/check/wechatid/',
    method: 'get',
    params
  })
}

export function addWechatId(data) {
  return request({
    url: '/wechatid/',
    method: 'post',
    data
  })
}

export function editWechatId(id, data) {
  return request({
    url: '/wechatid/' + id + '/',
    method: 'put',
    data
  })
}

export function viewWechatId(id) {
  return request({
    url: '/wechatid/' + id + '/',
    method: 'get'
  })
}

export function delWechatId(id) {
  return request({
    url: '/wechatid/' + id,
    method: 'delete'
  })
}

export function exportMobileAll() {
  return request({
    url: '/wechatid/export_all/',
    method: 'post'
  })
}

export function exportMobileCurrent(params) {
  return request({
    url: '/wechatid/export_current/',
    method: 'post',
    params
  })
}

export function DownloadTemplateFileWechatId() {
  return request({
    url: '/wechatid/download_template_file/',
    method: 'get'
  })
}

export function UploadDataFileWechatId(data) {
  return request({
    url: '/wechatid/import_file/',
    method: 'post',
    data
  })
}
